package com.zd.bms.bean.vo.resp;

import java.text.DecimalFormat;

import com.zd.common.bean.model.TicketOrderDetail;
import com.zd.common.common.enums.PrintStatusEnum;
import com.zd.common.common.enums.UseTicketsStatusEnum;
import com.zd.common.common.utils.DateTimeUtil;

public class TicketOrderDetailRespVo extends TicketOrderDetail {
	private String ticketName;
	private String prices;
	private String qrCode;
	

	
	public String getQrCode() {
		return qrCode;
	}

	public void setQrCode(String qrCode) {
		this.qrCode = qrCode;
	}

	public String getPrices() {
		return prices;
	}

	public void setPrices(Integer prices,double childRate) {
		 DecimalFormat df = new DecimalFormat("#0.00");
		if(this.getIsChild() == 0){
			this.prices ="￥" +df.format(prices/100.0) + "元";
		}else {
			this.prices ="￥" +df.format(prices/100.0*childRate) + "元";
		}
	}

	public String getTicketName() {
		return ticketName;
	}

	public void setTicketName(String ticketName) {
		this.ticketName = ticketName;
	}
	
	public String getPayTicketStr() throws Exception {//购票时间
		String payTicketStr = DateTimeUtil.date2String(this.getCreateTime());
		if( this.getEntryTime() == null){
			payTicketStr = "";
		}else {
			payTicketStr = DateTimeUtil.date2String(this.getCreateTime());
		}
		return payTicketStr;
	}
	
	
	public String getEntryTimeStr() throws Exception {//进场时间
		String entryTimeStr = DateTimeUtil.date2String(this.getEntryTime());
		if( this.getEntryTime() == null){
			entryTimeStr = "";
		}else {
			entryTimeStr = DateTimeUtil.date2String(this.getEntryTime());
		}
		return entryTimeStr;
	}
	
	public String getPrintTimeStr() throws Exception {//打印时间
		String printTimeStr = null;
		if(this.getPrintStatus() == PrintStatusEnum.Already_Printed.getKey()){
			if( this.getPrintTime() == null){
				printTimeStr = "";
			}else {
				printTimeStr = DateTimeUtil.date2String(this.getPrintTime());
			}
		}else {
			printTimeStr = PrintStatusEnum.Non_Printing.getValue();
		}
		return printTimeStr;
	}

	public String getValidTimeStr() throws Exception {//过期时间
		String validTimeStr = null;
		if( this.getValidTime() == null){
			validTimeStr = "";
		}else {
			validTimeStr = DateTimeUtil.date2String(this.getValidTime());
		}
		return validTimeStr;
	}

	public String getStatuStr() {
		String statuStr = new String();
		if(this.getStatus() == UseTicketsStatusEnum.Already_paid.getKey()){
			statuStr = UseTicketsStatusEnum.Already_paid.getValue();
		}
		if(this.getStatus() == UseTicketsStatusEnum.To_be_paid.getKey()){
			statuStr = UseTicketsStatusEnum.To_be_paid.getValue();
		}
		if(this.getStatus() == UseTicketsStatusEnum.Already_used.getKey()){
			statuStr = UseTicketsStatusEnum.Already_used.getValue();
		}
		if(this.getStatus() == UseTicketsStatusEnum.Have_a_refund.getKey()){
			statuStr = UseTicketsStatusEnum.Have_a_refund.getValue();
		}
		return statuStr;
	}
	
	public String getPrintStatuStr() {
		String printStatuStr = new String();
		if(this.getPrintStatus() == PrintStatusEnum.Already_Printed.getKey()){
			printStatuStr = PrintStatusEnum.Already_Printed.getValue();
		}
		if(this.getPrintStatus() == PrintStatusEnum.Non_Printing.getKey()){
			printStatuStr = PrintStatusEnum.Non_Printing.getValue();
		}
		
		return printStatuStr;
	}

}
